import pandas as pd
import os
import xlwings as xw
app = xw.App(visible=False, add_book=False)
wb = app.books.open('./后勤部.xlsx')
try:

    # 读取Excel文件中所有sheet中的内容
    df_list = pd.read_excel('./后勤部.xlsx', sheet_name=None)
    # print(df_list)
    df_all = pd.concat(df_list.values())
    # 读取app

    wb.sheets.add('merge', before=wb.sheets[0])  # 在第一个sheet之前添加新sheet
    wb.sheets['merge'].range('A1').options(index=False).value = df_all
finally:
    wb.save()
    wb.close()
    app.quit()
